/* 
 * @moduleName: BetweenColWrapperUtil.js
 * @Desc: 样式辅助函数
 * @Author: djkloop 
 * @Date: 2017-11-30 13:01:48 
 * @Last Modified by: djkloop
 * @Last Modified time: 2017-11-30 13:03:24
 */

import React from 'react'
import {Col, Row, Form} from 'antd';
const FormItem = Form.Item

export default {
  betweenColWrapper(beginFormItem, endFormItem, field) {
    return getFieldDecorator => (
      <Col key={`${field.key}Begin`} sm={8}>
        <Row>
          <Col span={16}>
            <FormItem key={`${field.key}Begin`} label={field.title} labelCol={{ span: 15 }} wrapperCol={{ span: 9 }}>
              {beginFormItem(getFieldDecorator)}
            </FormItem>
          </Col>
          <Col span={7} offset={1}>
            <FormItem key={`${field.key}End`} labelCol={{ span: 10 }} wrapperCol={{ span: 14 }}>
              {endFormItem(getFieldDecorator)}
            </FormItem>
          </Col>
        </Row>
      </Col>
    );
  },
}